home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C++ / Libraries / RgnMaster 1.0 / Source / Otherlies / About.c++ next >
Encoding:
C/C++ Source or Header  |  1994-04-25  |  1.0 KB  |  51 lines  |  [TEXT/KAHL]

  1. #include <Sound.h>
  2. #include "About.h"
  3.  
  4. const short kAboutID = 131;    // Rsrc id for dialog, picture, and sound.
  5.                             // If you delete the picture and/or sound, that's OK.
  6.                             // This routine WON'T crash; however, DO NOT distribute
  7.                             // the modified version!!!!
  8.  
  9. void DoRgnMasterAbout() {
  10.     Handle aboutPic;
  11.     Handle aboutSnd;
  12.     GrafPtr savePort;
  13.     DialogPtr aboutDlog;
  14.     short itemHit;
  15.  
  16.     // Do some pre-flighting...
  17.     aboutPic = GetResource('PICT', kAboutID);
  18.     if (aboutPic == nil) {
  19.         SysBeep(1);
  20.         return;
  21.     }
  22.     else {
  23.         ReleaseResource(aboutPic);    // Will be loaded by _GetNewDialog, below
  24.     }
  25.  
  26.     aboutSnd = GetResource('ASnd', kAboutID);
  27.     if (aboutSnd == nil) {
  28.         SysBeep(1);
  29.         return;
  30.     }
  31.     else {
  32.         HLockHi(aboutSnd);
  33.     }
  34.  
  35.     GetPort(&savePort);
  36.  
  37.     aboutDlog = GetNewDialog(kAboutID, nil, (WindowPtr)-1);
  38.     SetPort(aboutDlog);
  39.     ShowWindow(aboutDlog);
  40.     DrawDialog(aboutDlog);
  41.     
  42.     (void)SndPlay(nil, aboutSnd, false);    // Synchronous
  43.     ModalDialog(nil, &itemHit);
  44.     
  45.     HUnlock(aboutSnd);
  46.     HPurge(aboutSnd);
  47.  
  48.     DisposeDialog(aboutDlog);
  49.  
  50.     SetPort(savePort);
  51. } // END DoRgnMasterAbout